<script setup lang="ts">
import { createTestContext } from './useContext';
import ChildOne from './child-one.vue';

let name = ref('wfly');
const age = ref(18);
let height = $ref(180);

function handleClick () {
  name.value = 'par-wfly';
  age.value = 8;
  height = 188;
}

createTestContext({
  name,
  age: age.value,
  height
});
</script>

<template>
  <div>主组件</div>
  <div>名字：{{ name }} 年龄：{{ age }} 高度：{{ height }}</div>
  <button @click="handleClick">父级文件改变</button>
  <ChildOne/>
</template>

<style scoped lang="scss">

</style>
